// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import VueAxios from 'vue-axios';
import axios from 'axios';
import router from './router';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import * as filters from './filter'; // 全局filter
import './assets/iconfont/iconfont.css';
import MetaInfo from 'vue-meta-info'
import'./plugins/axios';
import Vuex from 'vuex' //引入状态管理
import store from './store/index'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'


Vue.config.productionTip = false

Vue.use(ElementUI);
Vue.use(VueAxios,axios);
Vue.use(MetaInfo);
Vue.use(Vuex);
Vue.use(VueAwesomeSwiper, /* { default global options } */);


Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

/* eslint-disable no-new */
router.afterEach((to,from,next) => {
  window.scrollTo(0,0);
});

new Vue({
  el: '#app',
  router,
  data:{
     dialogLogin:false,
     bLoading:false,
     active_index:0,
     goIndex:0,
     moveIndex:0,
     faceUrl:''
  },
  components: { App },
  template: '<App/>',
  store,
  mounted () {
    // document.dispatchEvent(new Event('render-event'))
    document.dispatchEvent(new Event('custom-render-trigger'))
  }
})



